package com.bookmarket.service.impl;

import com.bookmarket.dao.LJShopCartMapper;
import com.bookmarket.entity.Custom;
import com.bookmarket.entity.Shop;
import com.bookmarket.service.LJShopCartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service("/lJShopCartService")
public class LJShopCartServiceImpl implements LJShopCartService{


    @Resource
    private LJShopCartMapper ljShopCartMapper;


    //查询用户信息
    public Custom selectBy(String name){
        return ljShopCartMapper.selectBy(name);
    }

    public List<Shop> queryByCustom(Custom custom){
        System.out.println(custom.getName());
        return ljShopCartMapper.selectByCustom(custom);
    }
    //单个删除
    public boolean delShop(int id){
        return ljShopCartMapper.delShop(id);
    }
    //查购物车
    public Shop selectById(int id){
        return ljShopCartMapper.selectById(id);
    }
    //改变数据库购物车数量
    public void updateShop(int id,int num){
        ljShopCartMapper.updateShop(id,num);
    }



    public LJShopCartMapper getLjShopCartMapper() {
        return ljShopCartMapper;
    }

    public void setLjShopCartMapper(LJShopCartMapper ljShopCartMapper) {
        this.ljShopCartMapper = ljShopCartMapper;
    }
}
